#= 单独分离出的文件操作 =#

import LibSndFile
using PortAudio: PortAudioStream
using SampledSignals: s
using FileIO: save
using WAV

function save_to_desktop(buf)
    save(joinpath(homedir(), "Desktop", "myvoice.ogg"), buf)
end

function save_wav(data, filename=joinpath(homedir(), "Desktop", "myvoice.wav"))
    wavwrite(data, filename; Fs=S_num)
end